package cn.jy.erp.domain;

import java.util.ArrayList;
import java.util.List;

/**
 * 部门管理
 *
 * 使用者 : 系统管理员
 * @author cc
 * @create 2017-01-13 13:22
 **/
public class Department {
    private Long id;                                        // ID       数据库自动生成
    private String sn;                                      // 部门编号 文本      not null (此处感觉该用数字类型, 但文档要求文本)
    private String name;                                    // 部门名称 文本      not null
    private String dirPath;                                 // 路径     文本
    private Integer state;                                  // 状态 0 正常 ，-1停用        数字

    private Employee manager;                              // 部门经理 员工对象
    private Department parent;                              // 上级部门 部门对象
    private List<Department> children = new ArrayList<Department>();  // 子部门   集合属性   部门对象
   
    public Department() {

	}

	public Department(String name) {
		this.name = name;
	}
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Employee getManager() {
        return manager;
    }

    public void setManager(Employee manager) {
        this.manager = manager;
    }

    public Department getParent() {
        return parent;
    }

    public void setParent(Department parent) {
        this.parent = parent;
    }

    public List<Department> getChildren() {
        return children;
    }

    public void setChildren(List<Department> children) {
        this.children = children;
    }

    public String getDirPath() {
        return dirPath;
    }

    public void setDirPath(String dirPath) {
        this.dirPath = dirPath;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }
    
    /*兼容easyui*/
    public String getText() {
		return this.name;
	}

	@Override
	public String toString() {
		return "Department [id=" + id + ", sn=" + sn + ", name=" + name + ", dirPath=" + dirPath + ", state=" + state
				+ "]";
	}
    
    
}
